//
//  WeAuctionPublishBottomView.m
//  WeGalaxy
//
//  Created by Zheng on 2017/6/30.
//  Copyright © 2017年 Zheng. All rights reserved.
//

#import "WeAuctionPublishBottomView.h"

@interface WeAuctionPublishBottomView ()

@property (nonatomic, strong) UIButton *clickBtn;
@property (nonatomic, strong) UIView *lineView;

@end

@implementation WeAuctionPublishBottomView

#pragma mark - 点击事件
- (void)buttonClick:(UIButton *)sender {
    _clickBlock();
}

#pragma makr - 子视图
- (void)subviewsInView {
    [self addSubview:self.clickBtn];
    [self addSubview:self.lineView];
    
    [_clickBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.top.mas_equalTo(7);
        make.bottom.mas_equalTo(-6);
    }];
    
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.equalTo(self);
        make.height.mas_equalTo(0.5);
    }];
}

- (UIButton *)clickBtn {
    if (!_clickBtn) {
        _clickBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_clickBtn setTitle:@"确定发布" forState:UIControlStateNormal];
        _clickBtn.titleLabel.font = kCX_FONT(14);
        _clickBtn.backgroundColor = kRGB_COLOR(245, 66, 54, 1);
        [_clickBtn addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _clickBtn;
}

- (UIView *)lineView {
    if (!_lineView) {
        _lineView = [UIView new];
        _lineView.backgroundColor = kRGB_COLOR(200, 199, 204, 1);
    }
    return _lineView;
}

#pragma mark - 初始化
- (instancetype)init {
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        
        [self subviewsInView];
    }
    return self;
}




@end
